package com.xucia.strands;

import org.mozilla.javascript.Callable;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ContextFactory;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.SpawningContextFactory;

/**
 * This is a utility class for initializing Future/coroutine support and spawning new calls. Normally to 
 * initialize coroutine support, you should call initCoroutineSupport immediately after calling initStandardObjects
 * Context:
 * <pre>
  		scope = cx.initStandardObjects();
		CoroutineSupport.initCoroutineSupport(scope);
	</pre>  
 * @author Kris Zyp
 *
 */
public class CoroutineSupport {
	private CoroutineSupport() {		
	}
	/**
	 * Initializes the current scope for Future/coroutine support
	 * @param scope
	 */
	public static void initCoroutineSupport(Scriptable scope){
		initCoroutineSupport(scope,false);
	}
	/**
	 * Initializes the current scope for Future/coroutine support
	 * @param scope
	 * @param sealed
	 */
	public static void initCoroutineSupport(Scriptable scope,boolean sealed){
		Future.init(scope, sealed);
		
	}

}
